package org.example.service.mqtt.impl;

import lombok.Data;
import org.example.service.mqtt.TopicService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author 李荣
 * @Date 2025/1/3
 * @Description
 */

@Service
@ConfigurationProperties(prefix = "topic")
@Data
public class TopicServiceImpl implements TopicService {

    private String[] mqtt;
    private List<String> topicList = new ArrayList<>();
    @Override
    public List<String> getTopicsToSubscribe() {
        System.out.println(mqtt);
        topicList.addAll(Arrays.asList(mqtt));
        return topicList;
    }
}
